package com.yanqu.road.server.cmd.activity.douluodalu;

import com.yanqu.road.pb.activity.douluodalu.DouLuoDaLuProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.douluodalu.CrossDouLuoDaLuMgr;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = CrossProtocol.C_DOU_LUO_DA_LU_DRAW_HIDE_BOX, desc = "抽隐藏盲盒")
public class CrossDouLuoDaLuDrawHideBoxCmd extends CrossUnionCommand {

    int activityId;
    long serverId;
    long userId;

    private boolean canDrawHide = false;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        DouLuoDaLuProto.CrossDouLuoDaLuDrawHideBoxReqMsg reqMsg = DouLuoDaLuProto.CrossDouLuoDaLuDrawHideBoxReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        serverId = reqMsg.getServerId();
        userId = packet.getPlayerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        MessageHelper.sendPacket(serverId, userId, YanQuMessageUtils.buildMessage(GameProtocol.S_DOU_LUO_DA_LU_DRAW_HIDE_BOX_FROM_CROSS,
                CrossDouLuoDaLuMgr.drawHideBox(activityId, userId)));

    }

    @Override
    public void sendData() {

    }
}
